package com.neuedu.yyzx.controller;


import com.neuedu.yyzx.config.CommonResult;
import com.neuedu.yyzx.entity.RoleMenu;
import com.neuedu.yyzx.service.IRoleMenuService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 角色权限 前端控制器
 * </p>
 *
 * @author 第7组....
 * @since 2021-05-22
 */
@RestController
@RequestMapping("//roleMenu")
public class RoleMenuController {
    @Resource
    IRoleMenuService umsRolePermissionService;
    @GetMapping("/get-permiss")
    CommonResult getPermiss() {
        return CommonResult.success(umsRolePermissionService.getPermission());
    }
    @PostMapping("/save")
    CommonResult save(RoleMenu umsRolePermission) {
        return CommonResult.success(umsRolePermissionService.saveOrUpdate(umsRolePermission));
    }
    @GetMapping("/getByRoleId")
    CommonResult getByRoleId(Integer roleId) {
        return CommonResult.success(umsRolePermissionService.getByRoleId(roleId));
    }
}
